package com.naruto.json;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.*;

public class ResolveJson {

    public static void main(String[] args) {

        String str0 = "{\"F_DC_VB_ORDERAMOUNTSCORE\":\"0.00\",\"F_DC_VB_OVERDUERATEMAXSCORE\":\"0.00\",\"S_DC_VB_FCUSTNO\":\"0100020435\",\"S_DC_VS_IDNO\":\"430422198505308817\",\"S_DC_VB_ORDERPROV\":\"湖南\",\"S_DC_VS_PRDCODE\":\"PMC\",\"S_DC_VB_SALEORG\":\"三一汽车制造有限公司\",\"S_DC_VB_SALETOT\":\"1\",\"S_DC_VS_ENTRYID\":\"500082556\",\"S_DC_VB_FISOLDCUSTOMER\":\"2\",\"S_DC_VS_CTYPE\":\"2\",\"S_DC_VB_SALEREP\":\"PeterWong（王平/CRM-BA）\",\"F_DC_VB_OVERDUEPERIODSMAXSCORE\":\"15.00\",\"S_DC_VB_ORDERCITY\":\"长沙市\",\"S_DC_VS_ENTRYDEPARTMENT\":\"泵送\",\"S_DC_VS_MOBILE\":\"18073118530\",\"D_DC_VS_OCCURTIME\":\"2019-06-03 19:19:06\",\"D_DC_VB_APPLYDATE\":\"2019-06-03 19:19:06\",\"N_DC_VB_AGE\":\"34\",\"F_DC_VB_FFISRTPAYRATIOSCORE\":\"12.00\",\"S_DC_VB_OVERIND\":\"否\",\"N_DC_VB_LOANPER\":\"0\",\"S_DC_VB_CONT1MOBILE\":\"18073118530\",\"F_DC_VB_TOTALSCORE\":\"78.00\",\"F_DC_VB_MARRIAGESCORE\":\"0.00\",\"S_DC_VB_FFIRSTPAY\":\"100000.00\",\"S_DC_VB_GUARIND\":\"否\",\"S_DC_VB_CUSTLOANTYPE\":\"1\",\"S_DC_VB_ORDERAMT\":\"1000000.00\",\"F_DC_VB_FFISRTPAYRATIO\":\"10.00\",\"S_DC_VB_PRODTYPE\":\"12\",\"S_DC_VB_PROPRICE\":\"是\",\"F_DC_VB_BONDRATIO\":\"0.00\",\"S_DC_VB_PRODDETL\":\"[{\\\"prodname\\\":\\\"SY5423THB 520C-8泵车主体520C8B.0\\\",\\\"prodtot\\\":\\\"1.000 \\\",\\\"prodamt\\\":\\\"1000000.00 \\\"}]\",\"S_DC_VB_CARDREPAY\":\"10\",\"N_DC_VB_MAXOVERPER\":\"0\",\"S_DC_VB_RESIPROV\":\"简城街道办事处\",\"S_DC_VB_DISTOR\":\"湖南智汇\",\"S_DC_VB_IDTYPE\":\"1\",\"S_DC_VS_NAME\":\"贺红亮\",\"F_DC_VB_FIRSTSALEDATEINTERVALSCORE\":\"1.00\",\"F_DC_VB_LITIGATIONSCORE\":\"15.00\",\"F_DC_VB_OVERDUECOUNTSMAXSCORE\":\"10.00\",\"S_DC_VB_PAYMETH\":\"10\",\"S_DC_VS_ENTRYAREA\":\"长沙市\",\"S_DC_VB_SALETYPE\":\"02\"}";
        String str = "{\"finalDealTypeCode\":\"Review\",\"finalDealTypeName\":\"转人工\",\"nodeResult\":[{\"displayName\":\"个人_本地白名单准入类策略集\",\"nodeId\":\"ServiceTask_eb2beeaf-bb16-4646-a250-624bf5bf6508\",\"nodeName\":\"car_POrderApply\",\"nodeType\":\"1\",\"result\":{\"emergencySwithcOn\":false,\"finalDealType\":\"Accept\",\"finalDealTypeName\":\"通过\",\"final_score\":0,\"flowChargeSuccessed\":false,\"policy_name\":\"个人_本地白名单准入类策略集\",\"policy_set\":[{\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"FirstMatch\",\"policy_name\":\"本地名单_白名单准入\",\"policy_score\":0,\"policy_uuid\":\"036af42b68214cf8ae42fa242640a7c7\",\"risk_type\":\"creditRisk\"}],\"policy_set_name\":\"个人_本地白名单准入类策略集\",\"seq_id\":\"1559561850904-03223001\",\"spend_time\":3,\"success\":true},\"success\":true},{\"displayName\":\"云端_个人反欺诈服务\",\"nodeId\":\"ServiceTask_78c08ff9-0ae1-4500-aea7-5b32b1be7573\",\"nodeName\":\"BODYGUARD_ANTIFRAUD_SERVICE\",\"nodeType\":\"2\",\"result\":{\"code\":\"SUCCESS\",\"data\":{\"result\":\"{\\\"success\\\":true,\\\"id\\\":\\\"WF2019060319373093384537\\\",\\\"result_desc\\\":{\\\"ANTIFRAUD_LINKANALYSIS\\\":{\\\"detail\\\":\\\"查询无结果\\\"},\\\"INFOANALYSIS\\\":{\\\"id_age\\\":\\\"34\\\",\\\"address_detect\\\":{\\\"bank_card_address\\\":null,\\\"true_ip_address\\\":null,\\\"mobile_address_city\\\":\\\"长沙市\\\",\\\"id_card_city\\\":\\\"衡阳市\\\",\\\"mobile_address\\\":\\\"湖南省长沙市\\\",\\\"wifi_address\\\":null,\\\"id_card_province\\\":\\\"湖南省\\\",\\\"cell_address\\\":null,\\\"mobile_address_province\\\":\\\"湖南省\\\",\\\"id_card_address\\\":\\\"湖南省衡阳市衡南县\\\"},\\\"geoip_info\\\":{\\\"proxy_info\\\":null,\\\"isp\\\":null,\\\"latitude\\\":null,\\\"position\\\":null,\\\"longitude\\\":null},\\\"device_info\\\":{\\\"error\\\":\\\"参数缺失\\\"},\\\"geotrueip_info\\\":{\\\"isp\\\":null,\\\"latitude\\\":null,\\\"position\\\":null,\\\"longitude\\\":null},\\\"id_gender\\\":\\\"M\\\"},\\\"ANTIFRAUD_INFOQUERY\\\":{\\\"MobileAndNameAndIDCheck\\\":{\\\"mobile_three_element_consistence\\\":0},\\\"MobileOnlineStatus\\\":{\\\"mobile_online_status_consistence\\\":0,\\\"mobile_online_status_info\\\":\\\"正常在用\\\"}},\\\"ANTIFRAUD\\\":{\\\"output_fields\\\":{\\\"scorecard_reason_code\\\":\\\"最近2个月在工作日时间借款事件次数|当天注册事件次数|中午时间借款事件次数|当天借款事件次数|最近8天ID关联手机数\\\",\\\"police_consistence\\\":0,\\\"police_criminal_msg\\\":\\\"未比中\\\",\\\"antifraud_model_score\\\":8,\\\"police_criminal_status\\\":0},\\\"final_score\\\":24,\\\"risk_items\\\":[{\\\"rule_id\\\":39020954,\\\"policy_score\\\":24,\\\"score\\\":6,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Review\\\",\\\"policy_name\\\":\\\"车辆租赁分期_专业版_网页\\\",\\\"risk_name\\\":\\\"1个月内申请人在多个平台申请借款_排除厂商汽车金融\\\",\\\"risk_detail\\\":[{\\\"platform_detail_dimension\\\":[{\\\"count\\\":2,\\\"detail\\\":[{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"}],\\\"dimension\\\":\\\"借款人身份证\\\"},{\\\"count\\\":1,\\\"detail\\\":[{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"}],\\\"dimension\\\":\\\"借款人手机\\\"}],\\\"platform_detail\\\":[{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"}],\\\"description\\\":\\\"1个月内申请人在多个平台申请借款_排除厂商汽车金融\\\",\\\"type\\\":\\\"platform_detail\\\",\\\"platform_count\\\":2}]},{\\\"rule_id\\\":39020964,\\\"policy_score\\\":24,\\\"score\\\":8,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Review\\\",\\\"policy_name\\\":\\\"车辆租赁分期_专业版_网页\\\",\\\"risk_name\\\":\\\"3个月内申请人在多个平台申请借款_排除厂商汽车金融\\\",\\\"risk_detail\\\":[{\\\"platform_detail_dimension\\\":[{\\\"count\\\":6,\\\"detail\\\":[{\\\"count\\\":2,\\\"industry_display_name\\\":\\\"直销银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"网上银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"综合类电商平台\\\"}],\\\"dimension\\\":\\\"借款人身份证\\\"},{\\\"count\\\":1,\\\"detail\\\":[{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"}],\\\"dimension\\\":\\\"借款人手机\\\"}],\\\"platform_detail\\\":[{\\\"count\\\":2,\\\"industry_display_name\\\":\\\"直销银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"网上银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"综合类电商平台\\\"}],\\\"description\\\":\\\"3个月内申请人在多个平台申请借款_排除厂商汽车金融\\\",\\\"type\\\":\\\"platform_detail\\\",\\\"platform_count\\\":6}]},{\\\"rule_id\\\":39020974,\\\"policy_score\\\":24,\\\"score\\\":0,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Review\\\",\\\"policy_name\\\":\\\"车辆租赁分期_专业版_网页\\\",\\\"risk_name\\\":\\\"6个月内申请人在多个平台申请借款\\\",\\\"risk_detail\\\":[{\\\"platform_detail_dimension\\\":[{\\\"count\\\":1,\\\"detail\\\":[{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"}],\\\"dimension\\\":\\\"借款人手机\\\"},{\\\"count\\\":6,\\\"detail\\\":[{\\\"count\\\":2,\\\"industry_display_name\\\":\\\"直销银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"网上银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"综合类电商平台\\\"}],\\\"dimension\\\":\\\"借款人身份证\\\"}],\\\"platform_detail\\\":[{\\\"count\\\":2,\\\"industry_display_name\\\":\\\"直销银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"网上银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"综合类电商平台\\\"}],\\\"description\\\":\\\"6个月内申请人在多个平台申请借款\\\",\\\"type\\\":\\\"platform_detail\\\",\\\"platform_count\\\":6}]},{\\\"rule_id\\\":39020984,\\\"policy_score\\\":24,\\\"score\\\":0,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Review\\\",\\\"policy_name\\\":\\\"车辆租赁分期_专业版_网页\\\",\\\"risk_name\\\":\\\"12个月内申请人在多个平台申请借款\\\",\\\"risk_detail\\\":[{\\\"platform_detail_dimension\\\":[{\\\"count\\\":6,\\\"detail\\\":[{\\\"count\\\":2,\\\"industry_display_name\\\":\\\"直销银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"网上银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"综合类电商平台\\\"}],\\\"dimension\\\":\\\"借款人身份证\\\"},{\\\"count\\\":1,\\\"detail\\\":[{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"}],\\\"dimension\\\":\\\"借款人手机\\\"}],\\\"platform_detail\\\":[{\\\"count\\\":2,\\\"industry_display_name\\\":\\\"直销银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"网上银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"综合类电商平台\\\"}],\\\"description\\\":\\\"12个月内申请人在多个平台申请借款\\\",\\\"type\\\":\\\"platform_detail\\\",\\\"platform_count\\\":6}]},{\\\"rule_id\\\":39020994,\\\"policy_score\\\":24,\\\"score\\\":0,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Review\\\",\\\"policy_name\\\":\\\"车辆租赁分期_专业版_网页\\\",\\\"risk_name\\\":\\\"24个月内申请人在多个平台申请借款\\\",\\\"risk_detail\\\":[{\\\"platform_detail_dimension\\\":[{\\\"count\\\":1,\\\"detail\\\":[{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"}],\\\"dimension\\\":\\\"借款人手机\\\"},{\\\"count\\\":6,\\\"detail\\\":[{\\\"count\\\":2,\\\"industry_display_name\\\":\\\"直销银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"网上银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"综合类电商平台\\\"}],\\\"dimension\\\":\\\"借款人身份证\\\"}],\\\"platform_detail\\\":[{\\\"count\\\":2,\\\"industry_display_name\\\":\\\"直销银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"信用卡中心\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"网上银行\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"银行小微贷款\\\"},{\\\"count\\\":1,\\\"industry_display_name\\\":\\\"综合类电商平台\\\"}],\\\"description\\\":\\\"在指定时间内，主属性关联的合作方或行业类型的个数\\\",\\\"type\\\":\\\"platform_detail\\\",\\\"platform_count\\\":6}]},{\\\"rule_id\\\":39021224,\\\"policy_score\\\":24,\\\"score\\\":10,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Review\\\",\\\"policy_name\\\":\\\"车辆租赁分期_专业版_网页\\\",\\\"risk_name\\\":\\\"3个月内身份证关联多个申请信息\\\",\\\"risk_detail\\\":[{\\\"frequency_detail_list\\\":[{\\\"note\\\":\\\"3个月身份证关联手机号数\\\",\\\"phoneData\\\":[\\\"18073118530\\\",\\\"151※※※※4430\\\"],\\\"dim_type\\\":\\\"idNumber\\\",\\\"count\\\":\\\"2\\\",\\\"sub_dim_type\\\":\\\"accountMobile\\\",\\\"detail\\\":\\\"3个月身份证关联手机号数：2\\\"}],\\\"type\\\":\\\"frequency_detail\\\"}]},{\\\"rule_id\\\":39021364,\\\"policy_score\\\":24,\\\"score\\\":0,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Review\\\",\\\"policy_name\\\":\\\"车辆租赁分期_专业版_网页\\\",\\\"risk_name\\\":\\\"3个月内身份证号申请次数过多\\\",\\\"risk_detail\\\":[{\\\"frequency_detail_list\\\":[{\\\"note\\\":\\\"90天内_身份证_出现次数_全局\\\",\\\"dim_type\\\":\\\"idNumber\\\",\\\"count\\\":\\\"9\\\",\\\"detail\\\":\\\"90天内_身份证_出现次数_全局：9\\\"}],\\\"type\\\":\\\"frequency_detail\\\"}]},{\\\"rule_id\\\":39021374,\\\"policy_score\\\":24,\\\"score\\\":0,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Review\\\",\\\"policy_name\\\":\\\"车辆租赁分期_专业版_网页\\\",\\\"risk_name\\\":\\\"3个月内手机号申请次数过多\\\",\\\"risk_detail\\\":[{\\\"frequency_detail_list\\\":[{\\\"note\\\":\\\"90天内_手机号码_出现次数_全局\\\",\\\"dim_type\\\":\\\"accountMobile\\\",\\\"count\\\":\\\"4\\\",\\\"detail\\\":\\\"90天内_手机号码_出现次数_全局：4\\\"}],\\\"type\\\":\\\"frequency_detail\\\"}]},{\\\"rule_id\\\":39092344,\\\"policy_score\\\":1,\\\"score\\\":1,\\\"policy_mode\\\":\\\"Weighted\\\",\\\"decision\\\":\\\"Accept\\\",\\\"policy_decision\\\":\\\"Accept\\\",\\\"policy_name\\\":\\\"异常策略是否未命中\\\",\\\"risk_name\\\":\\\"未命中其他任何规则\\\"}],\\\"final_decision\\\":\\\"REVIEW\\\"}}}\"}},\"success\":true},{\"displayName\":\"个人_同盾云端信息校验策略集\",\"nodeId\":\"ServiceTask_749ca3e8-6b6a-41cc-880a-3b2e338e6d1e\",\"nodeName\":\"car_apply_info_check\",\"nodeType\":\"1\",\"result\":{\"emergencySwithcOn\":false,\"finalDealType\":\"Accept\",\"finalDealTypeName\":\"通过\",\"final_score\":0,\"flowChargeSuccessed\":false,\"policy_name\":\"个人_同盾云端信息校验策略集\",\"policy_set\":[{\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"WorstMatch\",\"policy_name\":\"手机三要素验证\",\"policy_score\":0,\"policy_uuid\":\"1e4b1d52b91a4d97a64f886a9acf0187\",\"risk_type\":\"creditRisk\"},{\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"WorstMatch\",\"policy_name\":\"手机在网状态核验\",\"policy_score\":0,\"policy_uuid\":\"01f4f4465d2b4a5b9a1d459965bde8d1\",\"risk_type\":\"suspiciousLoan\"}],\"policy_set_name\":\"个人_同盾云端信息校验策略集\",\"seq_id\":\"1559561850716-65385886\",\"spend_time\":1,\"success\":true},\"success\":true},{\"displayName\":\"个人_本地黑名单反欺诈策略集\",\"nodeId\":\"ServiceTask_1f4d4725-ad88-49fd-b40c-ce11b87f65be\",\"nodeName\":\"car_S_DC_VB_CUSTBLACK\",\"nodeType\":\"1\",\"result\":{\"emergencySwithcOn\":false,\"finalDealType\":\"Accept\",\"finalDealTypeGrade\":\"1\",\"finalDealTypeName\":\"通过\",\"final_score\":0,\"flowChargeSuccessed\":false,\"policy_name\":\"个人_本地黑名单反欺诈策略集\",\"policy_set\":[{\"dealType\":\"Accept\",\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"Weighted\",\"policy_name\":\"本地黑名单策略集\",\"policy_score\":0,\"policy_uuid\":\"c1c3e442259b421c8058444fe0ed782d\",\"risk_type\":\"suspiciousLoan\"}],\"policy_set_name\":\"个人_本地黑名单反欺诈策略集\",\"seq_id\":\"1559561850656-29261338\",\"spend_time\":4,\"success\":true},\"success\":true},{\"displayName\":\"个人_同盾云端反欺诈策略集\",\"nodeId\":\"ServiceTask_09b32439-a079-4fd6-9737-706861d5371f\",\"nodeName\":\"car_S_DC_VB_TDANTIFRAUD\",\"nodeType\":\"1\",\"result\":{\"emergencySwithcOn\":false,\"finalDealType\":\"Accept\",\"finalDealTypeGrade\":\"1\",\"finalDealTypeName\":\"通过\",\"final_score\":0,\"flowChargeSuccessed\":false,\"policy_name\":\"个人_同盾云端反欺诈策略集\",\"policy_set\":[{\"dealType\":\"Accept\",\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"Weighted\",\"policy_name\":\"云端联系人命中风险名单\",\"policy_score\":0,\"policy_uuid\":\"668c5adead564d99bb11450a634d6e3e\",\"risk_type\":\"suspiciousLoan\"},{\"dealType\":\"Accept\",\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"Weighted\",\"policy_name\":\"云端客户贷前反欺诈策略集\",\"policy_score\":0,\"policy_uuid\":\"2a99e17c16d44ca2b960c66a9c957b42\",\"risk_type\":\"suspiciousLoan\"}],\"policy_set_name\":\"个人_同盾云端反欺诈策略集\",\"seq_id\":\"1559561851302-00730992\",\"spend_time\":2,\"success\":true},\"success\":true},{\"displayName\":\"个人_客户综合黑名单策略集\",\"nodeId\":\"ServiceTask_e78ef78a-4a1b-4b5d-9040-5b26910b2095\",\"nodeName\":\"car_S_DC_VB_BLACKLISTLABEL\",\"nodeType\":\"1\",\"result\":{\"emergencySwithcOn\":false,\"finalDealType\":\"Accept\",\"finalDealTypeName\":\"通过\",\"final_score\":0,\"flowChargeSuccessed\":false,\"policy_name\":\"个人_客户综合黑名单策略集\",\"policy_set\":[{\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"WorstMatch\",\"policy_name\":\"个人客户是否命中名单风险\",\"policy_score\":0,\"policy_uuid\":\"24a82728a3dc456ba2b1015bde77c5b6\",\"risk_type\":\"suspiciousLoan\"}],\"policy_set_name\":\"个人_客户综合黑名单策略集\",\"seq_id\":\"1559561851144-90400503\",\"spend_time\":2,\"success\":true},\"success\":true},{\"displayName\":\"同盾_云端_个人贷前模型服务\",\"nodeId\":\"ServiceTask_83c9e529-fad8-4d8b-8598-64d3b49a92ad\",\"nodeName\":\"BODYGUARD_PRELOANMODEL_SERVICE\",\"nodeType\":\"2\",\"result\":{\"code\":\"SUCCESS\",\"data\":{\"S_GB_VB_R_K_FINANCIAL_CAPACITY_LEVEL_MEAN_12PLUS\":\"17\",\"F_GB_VB_S_K_ASSBALV4\":\"0.5\",\"F_GB_VB_S_K_FINANCIAL_STABILITY_LEVEL_12\":\"10\",\"S_GB_VB_R_K_FINANCIAL_STABILITY_LEVEL_12\":\"4\",\"F_GB_VB_S_K_FINANCIAL_CAPACITY_LEVEL_MEAN_12PLUS\":\"8.5\",\"F_GB_VB_S_K_ASSCREV14\":\"2\",\"S_GB_VB_R_MD_CREDIT_SCOREV3_V2\":\"[600,660)\",\"S_GB_VB_R_K_ASSDEBV14\":\"2\",\"S_DC_VB_R_M_LENGTH_LAST_LOAN_ALL_180DAY\":\"(1.2637,13.5547]\",\"F_GB_VB_CREDITSCORE\":\"60.08\",\"B_GB_VB_SUCCESS\":\"true\",\"F_DC_VB_S_I_RATIO_FREQ_RISK_ACCEPT_ALL_ALL_365DAY\":\"9.38\",\"F_DC_VB_CUSTSCORE\":\"60.08\",\"S_GB_VB_R_K_ASSCREV14\":\"1\",\"F_DC_VB_S_M_LENGTH_LAST_LOAN_ALL_180DAY\":\"9.7\",\"F_GB_VB_S_K_ASSDEBV14\":\"2\",\"S_GB_VB_R_K_ASSBALV4\":\"3\",\"F_GB_VB_S_MD_CREDIT_SCOREV3_V2\":\"18\",\"S_DC_VB_R_I_RATIO_FREQ_RISK_ACCEPT_ALL_ALL_365DAY\":\"(0.3333,0.5588]\"}},\"success\":true},{\"displayName\":\"产品保护价策略集\",\"nodeId\":\"ServiceTask_1d20c7c6-b9ab-474a-877f-bd17ad7e45ca\",\"nodeName\":\"car_proprice\",\"nodeType\":\"1\",\"result\":{\"emergencySwithcOn\":false,\"finalDealType\":\"Review\",\"finalDealTypeGrade\":\"10\",\"finalDealTypeName\":\"转人工\",\"final_score\":0,\"flowChargeSuccessed\":false,\"hit_rules\":[{\"decision\":\"\",\"id\":\"695\",\"name\":\"产品成交价低于产品保护价\",\"parentUuid\":\"\",\"ruleDetailDataList\":[],\"score\":0,\"uuid\":\"09a88609c68f4060b8fc15c77d7ce555\"}],\"policy_name\":\"产品保护价策略集\",\"policy_set\":[{\"dealType\":\"Review\",\"hit_rules\":[{\"decision\":\"\",\"id\":\"695\",\"name\":\"产品成交价低于产品保护价\",\"parentUuid\":\"\",\"ruleDetailDataList\":[],\"score\":0,\"uuid\":\"09a88609c68f4060b8fc15c77d7ce555\"}],\"hit_test_rules\":[],\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"FirstMatch\",\"policy_name\":\"是否满足产品保护价策略\",\"policy_score\":0,\"policy_uuid\":\"58679ca0596c47e4af9833ffc2bcf39d\",\"risk_type\":\"suspiciousLoan\"}],\"policy_set_name\":\"产品保护价策略集\",\"seq_id\":\"1559561851005-86355877\",\"spend_time\":2,\"success\":true},\"success\":true},{\"displayName\":\"人工审核策略集\",\"nodeId\":\"ServiceTask_388322f1-235c-4be6-a7b9-115b9c5fe31c\",\"nodeName\":\"car_apprReview\",\"nodeType\":\"1\",\"result\":{\"emergencySwithcOn\":false,\"finalDealType\":\"Review\",\"finalDealTypeGrade\":\"10\",\"finalDealTypeName\":\"转人工\",\"final_score\":0,\"flowChargeSuccessed\":false,\"hit_rules\":[{\"decision\":\"\",\"id\":\"527\",\"name\":\"不满足自动审批转人工审核\",\"parentUuid\":\"\",\"ruleDetailDataList\":[],\"score\":0,\"uuid\":\"8d3e30738116489a8bb0526687c911eb\"}],\"policy_name\":\"人工审核策略集\",\"policy_set\":[{\"dealType\":\"Review\",\"hit_rules\":[{\"decision\":\"\",\"id\":\"527\",\"name\":\"不满足自动审批转人工审核\",\"parentUuid\":\"\",\"ruleDetailDataList\":[],\"score\":0,\"uuid\":\"8d3e30738116489a8bb0526687c911eb\"}],\"hit_test_rules\":[],\"immunoRuleList\":[],\"policy_decision\":\"Accept\",\"policy_mode\":\"WorstMatch\",\"policy_name\":\"人工审核\",\"policy_score\":0,\"policy_uuid\":\"dc7beee3b7674f19a26e73a508f6b091\",\"risk_type\":\"suspiciousLoan\"}],\"policy_set_name\":\"人工审核策略集\",\"seq_id\":\"1559561851043-52318904\",\"spend_time\":2,\"success\":true},\"success\":true}],\"reasonCode\":9000,\"reasonDesc\":\"调用成功\",\"token\":\"token320143891758322670\"}";

        Object jsonObject = JSON.parseObject(str);

        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("sameKey", "");
        //针对 ["18073118530","151※※※※4430"] 这类数据,给个默认名称
        diguiFunction(jsonObject, hashMap, "初始化key,为单纯的array指定个默认初始化名称,一般用不上");
        for (Map.Entry<String, String> entry : hashMap.entrySet()) {
            System.out.println("key : " + entry.getKey() + "    value : " + entry.getValue());
        }

    }

    private static void diguiFunction(Object jsonObject, Map<String, String> hashMap, String superKey) {

        if (jsonObject instanceof JSONObject) {
            for (Map.Entry<String, Object> entry : ((Map<String, Object>) jsonObject).entrySet()) {

                String key = entry.getKey();

                Object value = testJson(entry.getValue());

                if (value instanceof JSONObject) {
                    diguiFunction(value, hashMap, key);
                } else if (value instanceof JSONArray) {
                    diguiFunction(value, hashMap, key);
                } else {
                    // 记录重复的 key
                    if (hashMap.containsKey(key)) {
                        String sameKey = hashMap.get("sameKey");
                        if (!sameKey.contains(key)) {
                            hashMap.put("sameKey", sameKey + "," + key);
                        }
                    }
                    hashMap.put(key, String.valueOf(value));
                }
            }
        } else if (jsonObject instanceof JSONArray) {
            //JSONArray 数组
            JSONArray arrays = (JSONArray) jsonObject;
            StringBuilder strs = new StringBuilder();
            for (Object array : arrays) {
                if (array instanceof JSONObject) {
                    diguiFunction(array, hashMap, superKey);
                } else if (array instanceof JSONArray) {
                    diguiFunction(array, hashMap, superKey);
                } else {
                    // 记录重复的 key
                    if (hashMap.containsKey(superKey)) {
                        String sameKey = hashMap.get("sameKey");
                        if (!sameKey.contains(superKey)) {
                            hashMap.put("sameKey", sameKey + "," + superKey);
                        }
                    }
                    //用于收集数组中的String值,其他值继续递归
                    //比如 str中的 phoneData
                    strs.append(array).append(",");
                }
            }
            //将array中单纯的 String 拼接成串来收集,其他的 JSONObjec 和 JSONArray 继续递归
            hashMap.put(superKey, strs.toString());
        } else {
            //这段逻辑是否并不需要?
            hashMap.put(superKey, String.valueOf(jsonObject));
            System.out.println("jsonArray(数组) : key=" + superKey + "    value=" + jsonObject);
        }

    }


    public static Object testJson(Object jsonStr) {
        try {
            if (jsonStr instanceof JSON) {
                return jsonStr;
            } else {
                Object object = JSON.parse(jsonStr instanceof String ? (String) jsonStr : jsonStr.toString());
                return object;
            }
        } catch (Exception e) {
            return jsonStr;
        }
    }


}
